package com.dmx.fw.service.impl;

import java.util.List;

import com.dmx.fw.bean.mapping.pojo.CacheCode;
import com.dmx.fw.bean.mapping.pojo.Resc;
import com.dmx.fw.dao.interfaces.CacheCodeDao;
import com.dmx.fw.service.interfaces.CacheCodeService;

public class CacheCodeServiceImpl extends BaseServiceImpl implements CacheCodeService {
	private CacheCodeDao cacheCodeDao;

	/**
	 * 取得“是、否”下拉框的内容
	 * @param 
	 * @return
	 */
	public List getIsCacheList() {
		return cacheCodeDao.getIsCacheList();
	}
	/**
	 * 取得“是、否”
	 * @param 
	 * @return
	 */
	public String getIsCacheTextByCode(String code) {
		return cacheCodeDao.getIsCacheTextByCode(code);
	}
	/**
	 * 根据ID取得一个Cache Code
	 * @param 
	 * @return
	 */
	public CacheCode getOneCacheCode(Long id) {
		return cacheCodeDao.getOneCacheCode(id);
	}
	/**
	 * 判断编码是否重复
	 * @param 
	 * @return
	 */
	public boolean checkCodeUnique(CacheCode cacheCode) {
		List temp = cacheCodeDao.findCacheCode(cacheCode);
		return temp.size()>0?true:false;
	}
	public CacheCodeDao getCacheCodeDao() {
		return cacheCodeDao;
	}
	public void setCacheCodeDao(CacheCodeDao cacheCodeDao) {
		this.cacheCodeDao = cacheCodeDao;
	}
}
